Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@stylable/runtime
Advanced tools
@stylable/runtime
provides the utility that is used to create the stylesheet functions that apply classNames
and states
to the DOM. It also exposes an optional DOM renderer that is responsible for loading CSS in its correct order.
End-users will usually not add this package directly as a dependency themselves, and would instead receive it as a dependency of their chosen integration (e.g. @stylable/webpack-plugin
).
@stylable/runtime
exposes two methods, Stylesheet
and Renderer
.
The stylesheet function is returned when importing a Stylable stylesheet. It is used for creating the DOM-attributes required for CSS to be applied.
style(className: string, states?: StateMap, props: InheritedAttributes)
Argument | Type | Description | Required |
---|---|---|---|
className | string | className to be namespaced | true |
states | StateMap | object containing states and their values | false |
inheritedAttributes | InheritedAttributes | props passed to the root node from the parent component (automatically passing through className and data-* attributes) | false |
import style from './local.st.css';
props = {
className: "app1211903207--root",
"data-app1211903207-propstate": true
}
style('root');
// returns "{
// "className": "local1211372639--root"
// }"
style('root', {localState: true});
// returns "{
// "data-local1211372639-localstate": true,
// "className": "local1211372639--root"
// }"
style('root', {localState: true}, props);
// returns "{
// "data-local1211372639-localstate": true,
// "data-app1211903207-propstate": true,
// "className": "local1211372639--root app1211903207--root"
// }"
// The stylesheet function also exposes a map of classNames and their namespaced values.
style.root;
// returns "local1211372639--root"
Responsible for managing CSS files, linking to the document
and maintaining their correct order in your application.
Copyright (c) 2017 Wix.com Ltd. All Rights Reserved. Use of this source code is governed by a BSD license.
FAQs
Stylable runtime DOM integration
The npm package @stylable/runtime receives a total of 3,462 weekly downloads. As such, @stylable/runtime popularity was classified as popular.
We found that @stylable/runtime demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.